<div class="body" >
<div class="order_search">
<form action="<?=site_url('admin990/orders/search')?>" method="get">
<label>ID:</label><input type="text" name="id" value=""><input type="submit" value="Recherche">
</form>

<form action="<?=site_url('admin990/orders/search')?>" method="get">
<label>e-mail:</label><input type="text" name="email" value=""><input type="submit" value="Recherche">
</form>

</div>



<div id="content" class="order_sum"><br><b><?=$date?>  &nbsp;[  Commandes: <?=$num?> ] [ Total: <?=number_format(array_sum($total_sum),1,'.','')?> € ]</b> <a href="javascript:void(0)"><img class="print" style="vertical-align: bottom;" src="<?=base_url()?>resources/imgs/printer.png" alt="print" title="print" height="17"></a>
<hr>
<table cellpadding="6" cellspacing="1" style="width:100%" border="0" align="center">

<tr style="background: #666;color:white;">
<td>N&deg; de commande</td>
<td>Client</td>
<td>L'heure de commande</td>
<td>Réduction</td> 
<td>Supplément</td> 
<td>Total</td> 
<td>Emporter | Livraison</td>
<td>Réservation</td>
<td>Détaille</td>
<td>Magazin</td>
</tr>

<?php if($orders){ foreach ($orders as $o):?>
<tr class="each_item" <?php if($o->shop_id == 1){?>style="background: #C8E685;"<?php }elseif ($o->shop_id == 2){?>style="background: #43B196;"<?php }else{?>style="background: #EF7CA5;"<?php }?>>
<td><?=$o->order_num?></td>
<td><?=$o->member->firstname?>&nbsp;<?=$o->member->lastname?></td>
<td><?=$o->order_time->format('short')?></td>
<td><?=$o->discount*100?>&nbsp;%</td>
<td><?if($o->extra != NULL){?><?=$o->extra?> €<?php }else{?>-  -  -<?php }?></td>
<td><?=number_format($o->total*(1-$o->discount)+$o->extra,1,'.','')?>&nbsp;€</td>
<td><?php if($o->takeaway_time !=NULL){ echo '<b>Emporter</b> '.$o->takeaway_time; }else{ echo '<b>Livraison</b> '.$o->delivery_time; }?></td>
<td class="msg"><?=$o->reservation?></td>
<td><a href="<?=site_url('admin990/orders/detail').'/'.$date_format.'/'.$o->order_num.'?per_page='.$this->uri->segment(7);?>"><img src="<?=base_url('resources/imgs/find.png')?>" width="18" alt="detail" title="détaille"></a></td>
<td><?=$o->shop->shop_name?></td>
</tr>
<?php endforeach; }else{ echo "<tr><td>Il n'y pas de commande...</td></tr>";}?>

</table>
<hr>
<?=$page_links?>
<hr>
<input type="button" value="<<= RETOUR" onclick="window.location.href='<?=site_url('admin990/orders')?>'">
</div>
</div>
<script src="<?=base_url()?>resources/js/jquery.PrintArea.js_4.js"></script>
<script>
$(".print").click(function(){

	                           $("#content").printArea( );
                      });
</script>